home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmMDIChild
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "MDI Child"
- ClientHeight = 975
- ClientLeft = 3360
- ClientTop = 4935
- ClientWidth = 3330
- Height = 1380
- Left = 3300
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- ScaleHeight = 975
- ScaleWidth = 3330
- Top = 4590
- Width = 3450
- Begin CommandButton cmdClose
- Cancel = -1 'True
- Caption = "Close"
- Default = -1 'True
- Height = 345
- Left = 1335
- TabIndex = 0
- Top = 315
- Width = 1485
- End
- Begin Image imgButtonUp
- Height = 330
- Left = 2865
- Picture = MDICHILD.FRX:0000
- Top = 15
- Visible = 0 'False
- Width = 360
- End
- Begin Image imgButtonDown
- Height = 330
- Left = 2865
- Picture = MDICHILD.FRX:0182
- Top = 345
- Visible = 0 'False
- Width = 360
- End
- Begin Image imgPopUp
- Height = 330
- Left = 450
- Top = 345
- Width = 360
- End
- Begin Label lblMenuClick
- BackColor = &H000000FF&
- ForeColor = &H000000FF&
- Height = 225
- Left = 2910
- TabIndex = 1
- Top = 735
- Visible = 0 'False
- Width = 285
- End
- Option Explicit
- Sub cmdClose_Click ()
- ' Unload the form when 'Close' is pressed
- Unload Me
- End Sub
- Sub Form_Load ()
- ' Show 'button up' image initially
- imgPopUp = imgButtonUp
- End Sub
- Sub HandleMyPopUp (P_nIndex As Integer)
- ' This sub would handle the clicks on the menu entries of the
- ' child popup menu received by lblMenuClick from frmMenuContainer
- Select Case P_nIndex
- Case 0:
- Case 1:
- Case 2:
- Case 3:
- End Select
- End Sub
- Sub imgPopUp_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Show 'button down' image
- imgPopUp = imgButtonDown
- ' Pop up the child menu defined in frmMenuContainer
- PopupMenu frmMenuContainer.mnuPopUpChild, 0
- ' Show 'button up' image
- imgPopUp = imgButtonUp
- End Sub
- Sub lblMenuClick_Change ()
- ' The 'Change' event of this label is triggered when a click on
- ' a menu entry in frmMenuContainer sets the label caption with the
- ' related menu entry index
- ' Handle the menu click if an index is available
- If lblMenuClick <> "" Then HandleMyPopUp Val(lblMenuClick)
- ' Reset the label for new menu entry clicks
- lblMenuClick = ""
- End Sub
-